const connection = require('./db');

const getImages = (callback,params) => {
    let sql = 'SELECT id,`timestamp`,picture_path FROM `sensor_data` where router_number= ? and picture_path <> ? ORDER BY id DESC  LIMIT 10';
    // const params = ['02','0']
    connection.query(sql, params,(error, results, fields) => {
        // if (error) throw error;

        callback(error,results,fields);
    });
};

// 导出函数
module.exports = {
    getImages
};






